package com.example.zq.player.pager;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.zq.player.R;
import com.example.zq.player.base.BasePager;
import com.example.zq.player.linked_database_interface.GlobalInformation;
import com.example.zq.player.linked_database_interface.LoginActivity;
import com.example.zq.player.linked_database_interface.MyInformationActivity;
import com.example.zq.player.linked_database_interface.base.BaseFragment;

/**
 * Created by zq on 2018/12/22.
 */

public class MyPager extends BaseFragment {
    @Override
    protected int initLayout() {
        return R.layout.my_pager;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }
    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        ImageView iv_my_pager_image = this.getActivity().findViewById(R.id.iv_my_pager_image);
        iv_my_pager_image.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MyPager.this.getActivity(), MyInformationActivity.class);
                MyPager.this.getActivity().startActivity(intent);
            }
        });

        Button bt_my_exit = this.getActivity().findViewById(R.id.bt_my_exit);
        bt_my_exit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                GlobalInformation.clearUser();

                Intent intent = new Intent(MyPager.this.getActivity(), LoginActivity.class);
                MyPager.this.getActivity().startActivity(intent);
                MyPager.this.getActivity().finish();
            }
        });
    }
}
